package huian.lee.entity.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the shoplevel table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="shoplevel"
 */

public abstract class BaseShoplevel  implements Serializable {

	public static String REF = "Shoplevel";
	public static String PROP_ID = "id";
	public static String PROP_LEVELNAME = "levelname";
	public static String PROP_LEVELPIC = "levelpic";


	// constructors
	public BaseShoplevel () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseShoplevel (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String levelname;
	private java.lang.String levelpic;

	// collections
	private java.util.Set<huian.lee.entity.Shopinfo> shopinfos;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: levelname
	 */
	public java.lang.String getLevelname () {
		return levelname;
	}

	/**
	 * Set the value related to the column: levelname
	 * @param levelname the levelname value
	 */
	public void setLevelname (java.lang.String levelname) {
		this.levelname = levelname;
	}



	/**
	 * Return the value associated with the column: levelpic
	 */
	public java.lang.String getLevelpic () {
		return levelpic;
	}

	/**
	 * Set the value related to the column: levelpic
	 * @param levelpic the levelpic value
	 */
	public void setLevelpic (java.lang.String levelpic) {
		this.levelpic = levelpic;
	}



	/**
	 * Return the value associated with the column: shopinfos
	 */
	public java.util.Set<huian.lee.entity.Shopinfo> getShopinfos () {
		return shopinfos;
	}

	/**
	 * Set the value related to the column: shopinfos
	 * @param shopinfos the shopinfos value
	 */
	public void setShopinfos (java.util.Set<huian.lee.entity.Shopinfo> shopinfos) {
		this.shopinfos = shopinfos;
	}

	public void addToshopinfos (huian.lee.entity.Shopinfo shopinfo) {
		if (null == getShopinfos()) setShopinfos(new java.util.TreeSet<huian.lee.entity.Shopinfo>());
		getShopinfos().add(shopinfo);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof huian.lee.entity.Shoplevel)) return false;
		else {
			huian.lee.entity.Shoplevel shoplevel = (huian.lee.entity.Shoplevel) obj;
			if (null == this.getId() || null == shoplevel.getId()) return false;
			else return (this.getId().equals(shoplevel.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}